package com.timeDeal.servlet;








import com.timeDeal.bean.JubaoBean;
import com.timeDeal.service.JubaoService;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;


/**
 * Created by Administrator on 2016/7/24.
 */

public class ChakanJubaoServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doGet(request,response);
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String jubaoid = request.getParameter("id");
        String currentpage = request.getParameter("currentpage");
        JubaoService jubaoService =new  JubaoService();
        JubaoBean jubaoBean = new JubaoBean() ;
        jubaoBean=jubaoService.getAJubaoById(Integer.valueOf(jubaoid));
        request.setAttribute("currentpage", currentpage);
        request.setAttribute("jubaoBean", jubaoBean);
        PrintWriter out = response.getWriter();
        System.out.println(jubaoBean.getJubaoyuanyin()+"222222222222222222222222");
       // out.print("<script>alert(\"查看 sucessful!\");</script>") ;
        request.getRequestDispatcher("/admin/chakanjubao.jsp").forward(request,response);





    }
}
